<!DOCTYPE html>
<html class="um landscape min-width-240px min-width-320px min-width-480px min-width-768px min-width-1024px">
    <head>
        <title></title>
        <meta charset="utf-8">
        <meta name="viewport" content="target-densitydpi=device-dpi, width=device-width, initial-scale=1, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
        <meta name="viewport" content="target-densitydpi=device-dpi, width=device-width, initial-scale=1, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">

        <link rel="stylesheet" href="css/project/ui-list-v3.css">
        <link rel="stylesheet" href="css/project/ui-res-v3.css">
        <link rel="stylesheet" href="css/project/ui-input-v3.css">
        <link rel="stylesheet" href="css/project/ui-btn-v3.css">
        <link rel="stylesheet" href="css/project/ui-color-v3.css">
        <link rel="stylesheet" href="css/ui-box.css">
        <link rel="stylesheet" href="css/ui-base.css">
        <link rel="stylesheet" href="css/ui-input.css">
        <link rel="stylesheet" href="css/clean/cleaning.css">
		<link rel="stylesheet" href="css/iBox.css">
	
        <script src="js/jquery-1.9.1.min.js"></script>
		<script src="js/clean/common.js"></script>
        <script src="js/zy_control.js"></script>
        <script src="js/zy_click.js"></script>
		<script src="js/iBox.js?v=202022"></script>
		<script src="js/clean/imgUpload.js"></script>
		<script src="js/talkingdata.js"></script>
    </head>
    <body class="um-vp" ontouchstart > 
        <!--块容器开始-->
        <div class="ub ub-ver">
            <!--第一区域-->
            <div class=" ub-f1 b-gra uinn  ulev-1" style="font-weight:bolder;">
                <!--第一行-->
                <div class="c-gra touming" style="padding:0.5em 0.3em 0.5em 0.3em">
                    <div class="ub t-bla">
                        <div class="ub ub-ac " style="width:22%">
                            航班日期
                        </div>
                        <div class="" style="width:25%">
                            <div class="c-wh uinput uinn3">
                                <input placeholder="" readonly type="text" style="font-weight:bolder;" id="flightDate" class="uc-a1">
                            </div>
                        </div>
                        <div class="" style="width:5%">
                        </div>
                        <div class="ub ub-ac" style="width:22% ">
                            航班号
                        </div>
                        <div class=" ub ub-ver " style="width:25%">
                            <div class="ub t-bla">
                                <div class="ub t-bla">
                                    <div class="ub-f1 uinn ulev-1 c-wh tx-l t-gra ulh-sel"  style="width:1.5em">
                                    <font id="carrier" style="font-weight:bolder;"></font>
									</div>
                                    <div class="c-06 ub ub-pc ub-ac">
                                        <div class="ub-img umw1 umh1 res3">
                                        </div>
                                    </div>
                                </div>
                                <!--下拉列表结束-->
                                <div class="ub-f1 c-wh uinput uinn3">
                                    <input placeholder="" readonly type="text" style="font-weight:bolder;" id="flightNo" class="uc-a1">
                                </div>
                            </div>
                        </div>
                    </div><!--第2行-->
                    <div class="ub t-bla " style="padding-top:1em">
                        <div class="ub ub-ac" style="width:22%">
                            机号
                        </div>
                        <div class="" style="width:25%">
                            <div class="c-wh uinput uinn3">
                                <input placeholder="" readonly type="text" style="font-weight:bolder;" id="acNo" class="uc-a1">
                            </div>
                        </div>
                        <div class="" style="width:5%">
                        </div>
                        <div class="ub ub-ac" style="width:22% ">
                            机型
                        </div>
                        <div class=" ub ub-ver " style="width:25%">
                            <div class="c-wh uinput uinn3">
                                <input placeholder="" readonly type="text" id="acType" class="uc-a1" style="font-weight:bolder;">
                            </div>
                        </div>
                    </div><!--第3行-->
                    <div class="ub t-bla " style="padding-top:1em">
                        <div class="ub ub-ac	" style="width:22%">
                            起飞站
                        </div>
                        <div class="" style="width:25%">
                            <div class="c-wh  uinput uinn3">
                                <input placeholder="" readonly type="text" id="depPort" class="uc-a1 uhide"><input placeholder="" style="font-weight:bolder;" readonly type="text" id="depPortName" class="uc-a1">
                            </div>
                        </div>
                        <div class="" style="width:5%">
                        </div>
                        <div class="ub ub-ac" style="width:22% ">
                            到达站
                        </div>
                        <div class=" ub ub-ver " style="width:25%">
                            <div class="c-wh  uinput uinn3">
                                <input placeholder="" readonly type="text" id="arrPort" class="uc-a1 uhide"><input placeholder="" style="font-weight:bolder;" readonly type="text" id="arrPortName" class="uc-a1 ">
                            </div>
                        </div>
                    </div><!--第4行-->
                    <div class="ub t-bla " style="padding-top:1em">
                        <div class="ub ub-ac	" style="width:22%">
                            桥位
                        </div>
                        <div class="" style="width:25%">
                            <div class="c-wh  uinput uinn3">
                                <input placeholder="" readonly type="text" id="bridge" style="font-weight:bolder;" class="uc-a1">
                            </div>
                        </div>
                        <div class="" style="width:5%">
                        </div>
                        <div class="ub ub-ac"  style="width:22% ">
                        </div>
                        <div class=" ub ub-ver " style="width:25%">
                        </div>
                    </div>
                </div>
            </div>
			 <!--块容器结束--><!--文本输入开始-->
            <div class="c-wh uinput umar-l umar-r" >
                <textarea placeholder=" 事件描述" id="affairRemark" name="textarea-0" class="uc-a1" style="min-height:4em;font-weight:bolder;"></textarea>
            </div>
			<!--第二区域-->
            <div class=" ub-f1 b-gra umar-a">
                <!--块容器开始-->
                <div class=" c-wh ">
                    <!--列表开始-->
                    <div class="">
                        <ul id="pictures" class="uc-t ub t-bla  lis" >
                            <li id="addImg" class="lis-th ub-img Img" style="width:32%;height:5.5em;" onclick="$.imgUpload().openMeun()">
                            </li>
                        </ul>
                    </div>
                    <!--列表结束-->
                </div>
            </div>
			<div class="umar-r umar-l c-gra touming">
				<!--事件区域-->
              <div id="affairLoc" style="font-weight:bolder;"></div>
			</div>
			  <div class="umar-a c-gra touming" style="font-weight:bolder;">
            <!--下拉列表开始-->
            <div class="ub t-bla uinn ">
                <div class="uinn ulim ulev-1">
                    事件类型
                </div>
                <div class="ub-f1 ub c-wh sel">
                    <div class="ub-f1 ut-s uinn ulev-1 tx-l t-gra ulh-sel" id="affairTypeName">
                    </div>
                    <div class="c-06 umw2 ub ub-pc ub-ac">
                        <div class="ub-img umw1 umh1 res3">
                        </div>
                    </div>
                    <select name="sel0" selectedindex="0" id="affairType" onchange="zy_selectmenu(this.id)">
                    </select>
                </div>
            </div>
            <!--下拉列表结束--><!--下拉列表开始-->
            <div class="ub t-bla uinn ">
                <div class="uinn ulim ulev-1">
                    分配部门
                </div>
                <div class="ub-f1 ub c-wh sel">
                    <div class="ub-f1 ut-s uinn ulev-1 tx-l t-gra ulh-sel" id="arrangeDeptName">
                    </div>
                    <div class="c-06 umw2 ub ub-pc ub-ac">
                        <div class="ub-img umw1 umh1 res3">
                        </div>
                    </div>
                    <select name="sel0" selectedindex="0" id="arrangeDept" onchange="zy_selectmenu(this.id)">
                    </select>
                </div>
            </div>
			</div>
            <!--下拉列表结束-->
            <div class="uc-b1 par-t" style="padding-bottom:0.8em;font-weight:bolder;">
			<div ontouchstart="zy_touch('btn-act')"  class="btn uba uinn5 t-wh umar-a tx-c" onclick="$.imgUpload().fileUp()">提&nbsp;&nbsp;交</div>
            </div>
        </div>
        <!--块容器结束-->
    </body>
    <script>
        zy_init();
        window.uexOnload = function(type){
			IC.talkingDataCount("客舱深度清洁","0021");
            var htmlJson = JSON.parse(getStorage("pageJson"));
			var properties = JSON.parse(getStorage("properties"));
			var submitDept = properties.submitdept;
			var affairType = properties.affairtype;
			var arrangeDept = properties.arrangedept;
			var affairLoc = properties.affairloc;
			var a=affairLoc.length;
			var b =parseInt(a/2);
			var c = a%2;
			var k =0;
			$$("affairLoc").innerHTML="";
			for(var i=0;i<b;i++){
				$$("affairLoc").innerHTML +='<div class="ub b-gra ulev-1 ub-f1 ">\
				    	<div class="ub-f1  uinn" style="width:50%">\
							<input type="checkbox" name="che1" class="uhide" value="'+affairLoc[k].codeorder+'">\
							<div onclick="zy_for(event)" ontouchstart="zy_touch(\'btn-act\')" class="ub uc-a1 t-bla">\
							    <div class="che-icon ub-img4 umw2 umh4"></div>\
								<div class="uinn">'+affairLoc[k].codevalue+'</div>\
							</div>\
				        </div>\
						<div class="ub-f1  uinn" style="width:50%">\
							<input type="checkbox" name="che1" class="uhide" value="'+affairLoc[k+1].codeorder+'">\
							<div onclick="zy_for(event)" ontouchstart="zy_touch(\'btn-act\')" class="ub uc-a1 t-bla">\
							    <div class="che-icon ub-img4 umw2 umh4"></div>\
								<div class="uinn">'+affairLoc[k+1].codevalue+'</div>\
							</div>\
				        </div>\
				    </div>';
				k+=2;
			}
//			k-=2;
			if(c==1){
					$$("affairLoc").innerHTML +='<div class="ub b-gra ub-f1 ulev-1">\
				    	<div class="ub-f1  uinn" style="width:50%">\
							<input type="checkbox" name="che1" class="uhide" value="'+affairLoc[k].codeorder+'">\
							<div onclick="zy_for(event)" ontouchstart="zy_touch(\'btn-act\')" class="ub uc-a1 t-bla">\
							    <div class="che-icon ub-img4 umw2 umh4"></div>\
								<div class="uinn">'+affairLoc[k].codevalue+'</div>\
							</div>\
				        </div>\
						<div class="ub-f1  uinn" style="width:50%">\
				        </div>\
				        </div>\
				    </div>';
			}
			/*****分配部门*****/
			for(var i=0;i<arrangeDept.length;i++){
				if(arrangeDept[i].codeorder==1){
					$("#arrangeDeptName").html(arrangeDept[i].codevalue);
					$("#arrangeDept").append("<option selected=true value='"+arrangeDept[i].codeorder+"' >"+arrangeDept[i].codevalue+"</option>");
				}else{
					$("#arrangeDept").append("<option  value='"+arrangeDept[i].codeorder+"'>"+arrangeDept[i].codevalue+"</option>");
				}
			}
			
			/*****事件类型*****/
			for(var i=0;i<affairType.length;i++){
				if(i==0){
					$("#affairTypeName").html(affairType[i].codevalue);
					$("#affairType").append("<option selected=true value='"+affairType[i].codeorder+"' >"+affairType[i].codevalue+"</option>");
				}else{
					$("#affairType").append("<option  value='"+affairType[i].codeorder+"'>"+affairType[i].codevalue+"</option>");
				}
			}
            $("#carrier").html(htmlJson.carrier);
            $("#acType").val(htmlJson.fleetCode);
            $("#acNo").val(htmlJson.tailno);
            $("#flightNo").val(htmlJson.flightNo);
            $("#flightDate").val(getStorage("dateTime"));
            $("#depPort").val(htmlJson.deptairPort);
            $("#depPortName").val(htmlJson.deptAirportName);
            $("#arrPort").val(htmlJson.arrairPort);
            $("#arrPortName").val(htmlJson.arrAirportName);
            $("#bridge").val(htmlJson.deptBay);
        }
        
       
        /**
         * 清洁事件上传
         */                                
        function upload(arry){
			IC.talkingDataCount("客舱深度清洁","0021");
            var carrier = $("#carrier").html();
            var acType = $("#acType").val();
            var acNo = $("#acNo").val();
            var flightNo = $("#flightNo").val();
            var flightDate = $("#flightDate").val();
            var depPort = $("#depPort").val();
            var arrPort = $("#arrPort").val();
            var bridge = $("#bridge").val();
			
			var affairLoc="";
			$('[name="che1"]:checked').each(function() {
				var zhi = $(this).val()+",";
				affairLoc +=zhi;
			});
			if(affairLoc.length==0){
				 $.iBoxMsg("请至少选择一个事件提交");
				 return;
			}
			affairLoc=affairLoc.substr(0,affairLoc.length-1);
            var affairType = $("#affairType").val();
            var affairRemark = $("#affairRemark").val();
			if(affairRemark==""){
				 $.iBoxMsg("请对申请事件进行描述");
				 return;
			}
            var arrangeDept = $("#arrangeDept").val();
            var submitDept = '1';//106 默认对应移动地服
            var submitMan = getStorage("submitMan");//账号名称
			if(undefined == submitMan){
				submitMan="测试";
			}
            //
            var parma = {"carrier":carrier=null?"":carrier,"acType":acType=null?"":acType,"acNo":acNo=null?"":acNo,"flightNo":flightNo=null?"":flightNo,"flightDate":flightDate=null?"":flightDate,"depPort":depPort=null?"":depPort,
			"arrPort":arrPort=null?"":arrPort,"bridge":bridge=null?"":bridge,"affairLoc":affairLoc=null?"":affairLoc,"affairType":affairType=null?"":affairType,"affairRemark":affairRemark=null?"":affairRemark,"arrangeDept":arrangeDept=null?"":arrangeDept,
			"submitDept":submitDept=null?"":submitDept,"submitMan":submitMan=null?"":submitMan,"fileNo":arry};
            $.ajax({
                //提交数据的类型 POST GET
                type: "POST",
                //提交的网址
                url: queryUrl+"clean",
                //提交的数据
                data: "parma="+JSON.stringify(parma),
                //返回数据的格式
                datatype: "json",//"xml", "html", "script", "json", "jsonp", "text".
                //成功返回之后调用的函数             
                success: function(json){
					json = JSON.parse(json);
				if(json.status==0){
					 $.iBoxMsg("提交成功");
					 setTimeout(function(){
						uexWindow.evaluateScript("deepCleaning","0","backPage()");
				 },2000);
				}else{
					 $.iBoxMsg("提交失败");
				}
                },
                //调用出错执行的函数
                error: function(err){
                    //请求出错处理
                   $.iBoxMsg("网络异常");
                }
            });
        }
    </script>
</html>
